\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
%\usepackage{german}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[dvipdfm]{color}
\usepackage[
    bookmarks,
    colorlinks,
    linkcolor=blue,
%    dvipdfm
]{hyperref}
\usepackage{epsfig}

\definecolor{grau}{rgb}{0.95, 0.95, 0.95}
\definecolor{rot}{rgb}{0.95, 0.8, 0.8}
\definecolor{gruen}{rgb}{0.8, 0.95, 0.8}
\definecolor{blau}{rgb}{0.8, 0.8, 0.95}

\newenvironment{code}[0]{\verbatim}{\endverbatim}
\newcommand{\exq}[1]{\begin{quote}\begin{alltt}#1\end{alltt}\end
{quote}}
\newcommand{\ex}[1]{\begin{alltt}#1\end{alltt}}
\newcommand{\boxquote}[3]{
\begin{center}
\colorbox{#1}%
{\parbox{0.75\textwidth}{\textsf{\underline{#2:} #3}}}
\end{center}}
\newcommand{\note}[1]{\boxquote{grau}{Note}{#1}}
\newcommand{\inmargin}[1]{\marginpar{\scriptsize\raggedright #1}}

\newcommand{\haskell}[0]{\textsc{Haskell}}
\newcommand{\frege}[0]{\textsc{Frege}}
\newcommand{\java}{\textsc{Java}}
\newcommand{\arrow}[0]{\begin{math}\rightarrow\end{math}}
\newcommand{\qq}[1]{"#1"}

\newcommand{\term}[1]{\textbf{\texttt{\textcolor{magenta}{#1}}}}
\newcommand{\nont}[1]{\textit{#1}}
\newcommand{\some}[1]{{\Large \{} #1 {\Large \}}}
\newcommand{\opt}[1]{{\Large [} #1 {\Large ]}}
\newcommand{\more}[1]{#1 {\Large \{} #1 {\Large \}}}
\newcommand{\liste}[2]{#1 \some{#2 #1}}
\newcommand{\rul}[1]{\nont{#1}:\\\hspace{0.5in} }
\newcommand{\alt}[0]{\\\hspace{0.5in}{\Large $|$} }
\newcommand{\checked}[1]{#1!}


\parindent0cm
\oddsidemargin1cm
\parskip2mm
\pagestyle{headings}

\date{last changed \today{} \\ $Revision$}
\author{\small{by Ingo Wechsung}}
\title{Implementation \& Users Guide for the \frege{} System}

\begin{document}
%\frontmatter
\maketitle

\begin{abstract}

This document describes the implementation of
the functional programming language \frege{}
which is described in
the \href{file:./Language.pdf}{Language Reference Guide}.


\end{abstract}

\tableofcontents

\listoffigures

%\mainmatter
\section{System Requirements and Prerequisites}

The \frege{} system comes as a collection of compiled \java{} classes packed in a jar-file.
It consists of 
\begin{itemize}
\item the \frege{} runtime (class {\tt frege.Run})
\item the \frege{} base libraries (classes {\tt frege.Prelude frege.List frege.IO})
\end{itemize}

\begin{itemize}
\item a computer with at least 256 megabytes of free RAM
\end{itemize}


\section{Known Bugs and Issues}

\subsection{Errors or warnings from the \java{} compiler}

The \frege{} compiler writes \java{} source code to a file in the destination directory,
which will be compiled by the \java compiler program. Normally, this compilation
should complete without any warnings or error messages. However, under certain circumstances
the source code will not compile or not compile without warnings. The subsequent
sections explain why.

\subsection{\java{} compiler reports syntax error when there is none}

The SUN SDK \java{} compilers from version 1.5.0\_01 on
\footnote{At the time of this writing, the bug was reported as open.
It may have been fixed meanwhile.
Please look at \url{http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6481655}}
sometimes incorrectly reports an error when a generic type appears in parenthesis.
More information can be obtained
\href{http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6481655}{here}.

Such code is typically generated with arrays that contain elements
of \java{} reference type. Here is a small example:

\begin{code}
package Failure where

foo = case if arr.length > 0 then true else false of
        true  -> 1
        false -> 0
    where arr = StringArr.new 1
\end{code}

This leads to the following errors:

\begin{code}
Failure.java:65: illegal start of expression
    if ((frege.Run.Arr.<java.lang.String>valen(arr$1000)>0)?true:false) {
                       ^
Failure.java:70: < expected
    assert  !((frege.Run.Arr.<java.lang.String>valen(arr$1000)>0)?true:false);
                                                                             ^
2 errors
javac terminated with exit code 1
\end{code}

A workaround is to reformulate the condition. Just write \ex{0 < arr.length} and now
for some reason it will be ok to have this \java{} code:

\begin{code}
if ((0<frege.Run.Arr.<java.lang.String>valen(arr$1000))?true:false) {
\end{code}

\end{document}